package pt.um.jspecput.util;

import java.security.Permission;

/**
 * The Class NoExitSecurityManager.
 */
public class NoExitSecurityManager extends SecurityManager {
        
    /* (non-Javadoc)
     * @see java.lang.SecurityManager#checkPermission(java.security.Permission)
     */
    @Override
    public void checkPermission(Permission perm) {
        // allow anything
        checkPermission(perm, null);
    }

    /* (non-Javadoc)
     * @see java.lang.SecurityManager#checkPermission(java.security.Permission, java.lang.Object)
     */
    @Override
    public void checkPermission(Permission perm, Object context) {
        // allow anything.
    }

    /* (non-Javadoc)
     * @see java.lang.SecurityManager#checkExit(int)
     */
    @Override
    public void checkExit(int status) {
        super.checkExit(status);
        throw new ExitException(status);
    }
}
